package project3;

/*
 * Abstract class for Open, Opened, Open Failed, Create, Created, Create Failed, Destroy
 */
public abstract class ConnectionCell extends Cell {
	protected ConnectionCell(int circId, Util.CellType cellType) {
		super(circId, cellType);
	}
	
	public static ConnectionCell createConnectionCell(int circId, Util.CellType cellType) {
		switch (cellType) {
			case OPEN: case OPENED: case OPEN_FAILED: return new OpenCell(circId, cellType);
			case CREATE: case CREATED: case CREATE_FAILED: return new CreateCell(circId, cellType);			
			case DESTROY: return new DestroyCell(circId, cellType);
			default: throw new IllegalArgumentException("invalid cell type for connection cell");
		}
	}	
}
